package org.crystal.tradecraft.model.binance.market.filter;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.crystal.tradecraft.model.binance.enumeration.FilterType;

/**
 * <h3>PERCENT_PRICE 价格振幅过滤器</h3>
 * 可以理解为一个瞬时的涨跌停限制，不允许价格瞬间剧烈浮动。 avgPriceMins 指用过去几分钟的平均价格来计算价格基准. 0 表示用最新成交价格作为价格计准。<p>
 * <p>
 * 逻辑伪代码如下：<p>
 * <ul>
 *     <li>price <= weightedAveragePrice * multiplierUp</li>
 *     <li>price >= weightedAveragePrice * multiplierDown</li>
 * </ul>
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class PercentPrice extends BinanceFilter {

    public PercentPrice() {
        super(FilterType.PERCENT_PRICE);
    }

    private double multiplierUp;

    private double multiplierDown;

    private int avgPriceMins;
}
